<script id="content" type="text/template">
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-shop_goods_state'()}-->" class="btn btn-default <!--if{http().anchor.query.shop_goods_state}--><!--else-->active<!--/if-->">全部商品状态</a>
		<a href="<!--helper {'anchor-query-shop_goods_state'('3')}-->" class="btn btn-default <!--if{http().anchor.query.shop_goods_state == '3'}-->active<!--/if-->">停售编辑中</a>
		<a href="<!--helper {'anchor-query-shop_goods_state'('2')}-->" class="btn btn-default <!--if{http().anchor.query.shop_goods_state == '2'}-->active<!--/if-->">等待审核</a>
		<a href="<!--helper {'anchor-query-shop_goods_state'('1')}-->" class="btn btn-default <!--if{http().anchor.query.shop_goods_state == '1'}-->active<!--/if-->">售卖中</a>
		<a href="<!--helper {'anchor-query-shop_goods_state'('0')}-->" class="btn btn-default <!--if{http().anchor.query.shop_goods_state == '0'}-->active<!--/if-->">审核失败</a>
	</div>
	
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-state'()}-->" class="btn btn-default <!--if{http().anchor.query.state}--><!--else-->active<!--/if-->">全部限时状态</a>
		<a href="<!--helper {'anchor-query-state'('2')}-->" class="btn btn-default <!--if{http().anchor.query.state == '2'}-->active<!--/if-->">未开始</a>
		<a href="<!--helper {'anchor-query-state'('1')}-->" class="btn btn-default <!--if{http().anchor.query.state == '1'}-->active<!--/if-->">进行中</a>
		<a href="<!--helper {'anchor-query-state'('0')}-->" class="btn btn-default <!--if{http().anchor.query.state == '0'}-->active<!--/if-->">已结束</a>
	</div>
	
  	<a href="#/shop/goods_when_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>
	<button class="btn btn-default" type="button" action-button="sort"><span class="glyphicon glyphicon-sort"></span> 排序</button>
	<!--<button class="btn btn-default" type="button" action-button="edit"><span class="glyphicon glyphicon-edit"></span> 编辑</button>-->
	<button class="btn btn-danger" type="button" action-button="remove"><span class="glyphicon glyphicon-trash"></span> 删除</button>
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
	
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th><input type="checkbox" action-table="checkbox-all"></th>	
          <th>#</th>
          <th>
          	<!--if{http().anchor.query.sort == "shop_goods_name_desc"}-->
          	<a href="javascript:;" action-sort="shop_goods_name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>商品名称</a>
          	<!--elseif{http().anchor.query.sort == "shop_goods_name_asc"}-->
          	<a href="javascript:;" action-sort="shop_goods_name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>商品名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="shop_goods_name_desc">商品名称</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "shop_goods_state_desc"}-->
          	<a href="javascript:;" action-sort="shop_goods_state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>商品状态</a>
          	<!--elseif{http().anchor.query.sort == "shop_goods_state_asc"}-->
          	<a href="javascript:;" action-sort="shop_goods_state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>商品状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="shop_goods_state_desc">商品状态</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "name_desc"}-->
          	<a href="javascript:;" action-sort="name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>名称</a>
          	<!--elseif{http().anchor.query.sort == "name_asc"}-->
          	<a href="javascript:;" action-sort="name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="name_desc">名称</a>
          	<!--/if-->
          </th>
          <th>描述</th>
          <th>
          	<!--if{http().anchor.query.sort == "state_desc"}-->
          	<a href="javascript:;" action-sort="state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>限时状态</a>
          	<!--elseif{http().anchor.query.sort == "state_asc"}-->
          	<a href="javascript:;" action-sort="state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>限时状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="state_desc">限时状态</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "start_time_desc"}-->
          	<a href="javascript:;" action-sort="start_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>开始时间</a>
          	<!--elseif{http().anchor.query.sort == "start_time_asc"}-->
          	<a href="javascript:;" action-sort="start_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>开始时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="start_time_desc">开始时间</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "end_time_desc"}-->
          	<a href="javascript:;" action-sort="end_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>结束时间</a>
          	<!--elseif{http().anchor.query.sort == "end_time_asc"}-->
          	<a href="javascript:;" action-sort="end_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>结束时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="end_time_desc">结束时间</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "sort_desc"}-->
          	<a href="javascript:;" action-sort="sort_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>排序</a>
          	<!--elseif{http().anchor.query.sort == "sort_asc"}-->
          	<a href="javascript:;" action-sort="sort_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>排序</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sort_desc">排序</a>
          	<!--/if-->
          </th>
          
          
          
          <th>
          	<!--if{http().anchor.query.sort == "update_time_desc"}-->
          	<a href="javascript:;" action-sort="update_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>更新时间</a>
          	<!--elseif{http().anchor.query.sort == "update_time_asc"}-->
          	<a href="javascript:;" action-sort="update_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>更新时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="update_time_desc">更新时间</a>
          	<!--/if-->
          </th>
          
          
          
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].shop_goods_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <td><!--{response.list.data[i].shop_goods_name}--></td>
          <td>
          <!--if{parseInt(response.list.data[i].shop_goods_state) == 0}-->
          <span class="label label-danger">审核失败</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 1}-->
          <span class="label label-success">售卖中</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 2}-->
          <span class="label label-warning">等待审核</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 3}-->
          <span class="label label-info">停售编辑中</span>
          <!--/if-->
          </td>
          <td><!--{response.list.data[i].shop_goods_when_name}--></td>
          <td><div id="tips-<!--{response.list.data[i].shop_goods_when_info}-->" class="tips" data-title="查看分类简介" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 150px;cursor: pointer;" data="<!--{response.list.data[i].shop_goods_when_info}-->"><!--{response.list.data[i].shop_goods_when_info}--></div></td>
          <td>
          <!--if{parseInt(response.list.data[i].shop_goods_when_state) == 0}-->
          <span class="label label-danger">已结束</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_when_state) == 1}-->
          <span class="label label-success">进行中</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_when_state) == 2}-->
          <span class="label label-warning">未开始</span>
          <!--else-->
          <span class="label label-default">未知</span>
          <!--/if-->
          </td>
          
          <td><!--{WangAho().date("yyyy-MM-dd HH:mm:ss", parseInt(response.list.data[i].shop_goods_when_start_time) * 1000)}--></td>
          <td><!--{WangAho().date("yyyy-MM-dd HH:mm:ss", parseInt(response.list.data[i].shop_goods_when_end_time) * 1000)}--></td>
          
          <td><input style="width: 80px;" type="text" class="form-control" placeholder="排序" action-table="sort" data-id="<!--{response.list.data[i].shop_goods_id}-->" value="<!--{response.list.data[i].shop_goods_when_sort}-->"></td>
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].shop_goods_when_update_time) * 1000)}--></td>
          <td>
          	<a href="#/shop/goods_when_edit?id=<!--{response.list.data[i].shop_goods_id}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          	<a href="#/shop/goods_edit?id=<!--{response.list.data[i].shop_goods_id}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑商品</a>
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="10" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
	
	
	
</script>



<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>商品ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的商品ID" name="shop_goods_id" value="<!--{search.shop_goods_id}-->">
		</div>
		<div class="form-group">
		    <label>商品名称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的商品名称" name="shop_goods_name" value="<!--{search.shop_goods_name}-->">
		</div>
		
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>


